package com.woniuxy.power.core.service.impl;

import com.woniuxy.power.core.model.YdStation;
import com.woniuxy.power.core.mapper.YdStationMapper;
import com.woniuxy.power.core.service.YdStationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author gmx
 * @since 2021-06-29
 */
@Service
public class YdStationServiceImpl extends ServiceImpl<YdStationMapper, YdStation> implements YdStationService {

    @Resource
    private YdStationMapper mapper;

    @Override
    public List<YdStation> selectStation() {
        List<YdStation> list = this.mapper.selectStation();
        return list;
    }

    @Override
    public int updateStatus(YdStation ydStation) {
        ydStation.setStationStatus("上架");
        int i = this.mapper.updateById(ydStation);
        return i;
    }

    @Override
    public int updateDisStatus(YdStation ydStation) {
        ydStation.setStationStatus("下架");
        int i = this.mapper.updateById(ydStation);
        return i;
    }
}
